'''
Created on 2009-9-14

@author: loudly
'''
# models.py

from google.appengine.ext import db
from google.appengine.ext.db import polymodel

from models import Game
from models import Round

class OfficialMahjongGame(Game):
    totalSessions = db.IntegerProperty(required = True)
    sumScores = db.ListProperty(int)
    
class OfficialMahjongSession(Round):
    game = db.ReferenceProperty(OfficialMahjongGame, collection_name='sessions')
    
    sumScores = db.ListProperty(int)
    sumFans = db.ListProperty(int)

class OfficialMahjongHand(Round):
    session = db.ReferenceProperty(OfficialMahjongSession, collection_name='hands')
    
    roundWind = db.StringProperty(choices=('east', 'south', 'west', 'north'))
    seatWind = db.StringProperty(choices=('east', 'south', 'west', 'north'))
    fans = db.ListProperty(int)
    fanNames = db.ListProperty(unicode)